package com.coscon.model;



import com.coscon.model.api.ResponseCode;

import java.io.Serializable;

public class ResponseResult<T> implements Serializable {
    private static final long serialVersionUID = 1L;
    private int code;
    private boolean success;
    private String message;
    private String messageDtl;
    private T data;

    public ResponseResult() {
        this.code = ResponseCode.OK.getCode();
        this.success = Boolean.TRUE;
    }

    public ResponseResult(T data) {
        this.code = ResponseCode.OK.getCode();
        this.success = Boolean.TRUE;
        this.data = data;
    }

    public ResponseResult(int code, String message, T data) {
        this.code = ResponseCode.OK.getCode();
        this.success = Boolean.TRUE;
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResponseResult(int code, String message) {
        this.code = ResponseCode.OK.getCode();
        this.success = Boolean.TRUE;
        this.code = code;
        this.message = message;
    }

    public ResponseResult(int code, boolean success) {
        this.code = ResponseCode.OK.getCode();
        this.success = Boolean.TRUE;
        this.code = code;
        this.success = success;
    }

    public ResponseResult(int code, boolean success, String message) {
        this.code = ResponseCode.OK.getCode();
        this.success = Boolean.TRUE;
        this.code = code;
        this.message = message;
        this.success = success;
    }

    public ResponseResult(T data, String message) {
        this.code = ResponseCode.OK.getCode();
        this.success = Boolean.TRUE;
        this.data = data;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isSuccess() {
        return this.success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return this.data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMessageDtl() {
        return this.messageDtl;
    }

    public void setMessageDtl(String messageDtl) {
        this.messageDtl = messageDtl;
    }
}
